Skip to content

Use iterative traversal for deeply nested constraints#31

Open
1Jul1an wants to merge 1 commit intoUniversal-Variability-Language:mainfrom
1Jul1an:fix/long-constraint-stack-overflow
Open

Use iterative traversal for deeply nested constraints#31
1Jul1an wants to merge 1 commit intoUniversal-Variability-Language:mainfrom
1Jul1an:fix/long-constraint-stack-overflow

Conversation

@1Jul1an
Copy link
Copy Markdown

@1Jul1an 1Jul1an commented Apr 24, 2026

Long UVL constraints can create deeply nested parse and constraint trees. The default ANTLR ParseTreeWalker and the type-level constraint validation both traversed these structures recursively, which can overflow the Java stack for constraints with thousands of literals.

This change introduces an iterative ParseTreeWalker and validates type-level constraints with an explicit stack while preserving traversal order.

A regression test covers a generated UVL model with 7000 OR-connected literals.

Related to FeatureIDE/FeatureIDE#1458

Tested with:

mvn clean test

@SundermannC
Copy link
Copy Markdown
Member

Hi @1Jul1an,
thanks a lot for preparing this PR. The changes seem very valuable and we appreciate it very much. We will examine the changes and run some tests with it ASAP and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants